package crazy.collection;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class ListTest
{
	public static void main(String[] args)
	{
		Apple t1 = new Apple(2.2);
		Apple t2 = new Apple(1.8);
		
		List<Apple> list = new ArrayList<Apple>(4);//如果没传入int,初始长度是10
		list.add(t1);
		list.add(t2);
		
		System.out.println(list.get(0) == t1);
		System.out.println(list.get(1) == t2);
	}
}

class Apple
{
	double weight;
	
	public Apple(double weight)
	{
		this.weight = weight;
	}
}
